// package-product/pages/withdraw-record/index.js
const app = getApp();
import { PageListMixins } from '../../../behaviors/page';
import { WITHDRAW_LOG_STATUS } from '../../../constants/common';
import { showLoading, hideLoading } from '../../../common/env';
import { getUserWithdrawLog } from '../../../api/usr';

Page({
    mixins: [PageListMixins],
    data: {
        WITHDRAW_LOG_STATUS,
        logList: [],
    },
    getListData: async function (isReplace = false) {
        showLoading('加载中...');
        const { pageSize, pageNo, pageTime, logList } = this.data;
        const param = {
            pageSize,
            pageNo,
            pageTime,
        };
        const list = await getUserWithdrawLog(param);
        this.setData({
            logList: isReplace ? list : [...logList, ...list],
        });
        hideLoading();
    },
})
